Optimal. Leaf size=227 \[ -\frac {\sqrt {d} \text {ArcTan}\left (1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{4 \sqrt {2} f}+\frac {\sqrt {d} \text {ArcTan}\left (1+\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{4 \sqrt {2} f}+\frac {\sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{8 \sqrt {2} f}-\frac {\sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{8 \sqrt {2} f}+\frac {\cos ^2(e+f x) (d \tan (e+f x))^{3/2}}{2 d f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 227, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 9, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {2687, 296,
335, 303, 1176, 631, 210, 1179, 642} \begin {gather*} -\frac {\sqrt {d} \text {ArcTan}\left (1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{4 \sqrt {2} f}+\frac {\sqrt {d} \text {ArcTan}\left (\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}+1\right )}{4 \sqrt {2} f}+\frac {\sqrt {d} \log \left (\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}+\sqrt {d}\right )}{8 \sqrt {2} f}-\frac {\sqrt {d} \log \left (\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}+\sqrt {d}\right )}{8 \sqrt {2} f}+\frac {\cos ^2(e+f x) (d \tan (e+f x))^{3/2}}{2 d f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 296
Rule 303
Rule 335
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 2687
Rubi steps
\begin {align*} \int \cos ^2(e+f x) \sqrt {d \tan (e+f x)} \, dx &=\frac {\text {Subst}\left (\int \frac {\sqrt {d x}}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\cos ^2(e+f x) (d \tan (e+f x))^{3/2}}{2 d f}+\frac {\text {Subst}\left (\int \frac {\sqrt {d x}}{1+x^2} \, dx,x,\tan (e+f x)\right )}{4 f}\\ &=\frac {\cos ^2(e+f x) (d \tan (e+f x))^{3/2}}{2 d f}+\frac {\text {Subst}\left (\int \frac {x^2}{1+\frac {x^4}{d^2}} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{2 d f}\\ &=\frac {\cos ^2(e+f x) (d \tan (e+f x))^{3/2}}{2 d f}-\frac {\text {Subst}\left (\int \frac {d-x^2}{1+\frac {x^4}{d^2}} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{4 d f}+\frac {\text {Subst}\left (\int \frac {d+x^2}{1+\frac {x^4}{d^2}} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{4 d f}\\ &=\frac {\cos ^2(e+f x) (d \tan (e+f x))^{3/2}}{2 d f}+\frac {\sqrt {d} \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {d}+2 x}{-d-\sqrt {2} \sqrt {d} x-x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{8 \sqrt {2} f}+\frac {\sqrt {d} \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {d}-2 x}{-d+\sqrt {2} \sqrt {d} x-x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{8 \sqrt {2} f}+\frac {d \text {Subst}\left (\int \frac {1}{d-\sqrt {2} \sqrt {d} x+x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{8 f}+\frac {d \text {Subst}\left (\int \frac {1}{d+\sqrt {2} \sqrt {d} x+x^2} \, dx,x,\sqrt {d \tan (e+f x)}\right )}{8 f}\\ &=\frac {\sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{8 \sqrt {2} f}-\frac {\sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{8 \sqrt {2} f}+\frac {\cos ^2(e+f x) (d \tan (e+f x))^{3/2}}{2 d f}+\frac {\sqrt {d} \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{4 \sqrt {2} f}-\frac {\sqrt {d} \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{4 \sqrt {2} f}\\ &=-\frac {\sqrt {d} \tan ^{-1}\left (1-\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{4 \sqrt {2} f}+\frac {\sqrt {d} \tan ^{-1}\left (1+\frac {\sqrt {2} \sqrt {d \tan (e+f x)}}{\sqrt {d}}\right )}{4 \sqrt {2} f}+\frac {\sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)-\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{8 \sqrt {2} f}-\frac {\sqrt {d} \log \left (\sqrt {d}+\sqrt {d} \tan (e+f x)+\sqrt {2} \sqrt {d \tan (e+f x)}\right )}{8 \sqrt {2} f}+\frac {\cos ^2(e+f x) (d \tan (e+f x))^{3/2}}{2 d f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.21, size = 102, normalized size = 0.45 \begin {gather*} -\frac {\left (\text {ArcSin}(\cos (e+f x)-\sin (e+f x)) \csc (e+f x)+\csc (e+f x) \log \left (\cos (e+f x)+\sin (e+f x)+\sqrt {\sin (2 (e+f x))}\right )-2 \sqrt {\sin (2 (e+f x))}\right ) \sqrt {\sin (2 (e+f x))} \sqrt {d \tan (e+f x)}}{8 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 0.36, size = 522, normalized size = 2.30
method | result | size |
default | \(\frac {\left (\cos \left (f x +e \right )-1\right ) \left (-i \sqrt {\frac {\cos \left (f x +e \right )-1}{\sin \left (f x +e \right )}}\, \sqrt {\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {-\frac {-1+\cos \left (f x +e \right )-\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \EllipticPi \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )-\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )+i \sqrt {\frac {\cos \left (f x +e \right )-1}{\sin \left (f x +e \right )}}\, \sqrt {\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {-\frac {-1+\cos \left (f x +e \right )-\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \EllipticPi \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )-\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )+\sqrt {\frac {\cos \left (f x +e \right )-1}{\sin \left (f x +e \right )}}\, \sqrt {\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {-\frac {-1+\cos \left (f x +e \right )-\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \EllipticPi \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )-\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right )+\sqrt {\frac {\cos \left (f x +e \right )-1}{\sin \left (f x +e \right )}}\, \sqrt {\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \sqrt {-\frac {-1+\cos \left (f x +e \right )-\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}\, \EllipticPi \left (\sqrt {-\frac {-1+\cos \left (f x +e \right )-\sin \left (f x +e \right )}{\sin \left (f x +e \right )}}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right )+2 \left (\cos ^{2}\left (f x +e \right )\right ) \sqrt {2}-2 \cos \left (f x +e \right ) \sqrt {2}\right ) \left (\cos \left (f x +e \right )+1\right )^{2} \sqrt {\frac {d \sin \left (f x +e \right )}{\cos \left (f x +e \right )}}\, \sqrt {2}}{8 f \sin \left (f x +e \right )^{3}}\) | \(522\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 201, normalized size = 0.89 \begin {gather*} \frac {d^{2} {\left (\frac {2 \, \sqrt {2} \arctan \left (\frac {\sqrt {2} {\left (\sqrt {2} \sqrt {d} + 2 \, \sqrt {d \tan \left (f x + e\right )}\right )}}{2 \, \sqrt {d}}\right )}{\sqrt {d}} + \frac {2 \, \sqrt {2} \arctan \left (-\frac {\sqrt {2} {\left (\sqrt {2} \sqrt {d} - 2 \, \sqrt {d \tan \left (f x + e\right )}\right )}}{2 \, \sqrt {d}}\right )}{\sqrt {d}} - \frac {\sqrt {2} \log \left (d \tan \left (f x + e\right ) + \sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {d} + d\right )}{\sqrt {d}} + \frac {\sqrt {2} \log \left (d \tan \left (f x + e\right ) - \sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {d} + d\right )}{\sqrt {d}}\right )} + \frac {8 \, \left (d \tan \left (f x + e\right )\right )^{\frac {3}{2}} d^{2}}{d^{2} \tan \left (f x + e\right )^{2} + d^{2}}}{16 \, d f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 2009 vs.
\(2 (179) = 358\).
time = 64.70, size = 2009, normalized size = 8.85 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {d \tan {\left (e + f x \right )}} \cos ^{2}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 227, normalized size = 1.00 \begin {gather*} \frac {\frac {8 \, \sqrt {d \tan \left (f x + e\right )} d^{3} \tan \left (f x + e\right )}{{\left (d^{2} \tan \left (f x + e\right )^{2} + d^{2}\right )} f} + \frac {2 \, \sqrt {2} {\left | d \right |}^{\frac {3}{2}} \arctan \left (\frac {\sqrt {2} {\left (\sqrt {2} \sqrt {{\left | d \right |}} + 2 \, \sqrt {d \tan \left (f x + e\right )}\right )}}{2 \, \sqrt {{\left | d \right |}}}\right )}{f} + \frac {2 \, \sqrt {2} {\left | d \right |}^{\frac {3}{2}} \arctan \left (-\frac {\sqrt {2} {\left (\sqrt {2} \sqrt {{\left | d \right |}} - 2 \, \sqrt {d \tan \left (f x + e\right )}\right )}}{2 \, \sqrt {{\left | d \right |}}}\right )}{f} - \frac {\sqrt {2} {\left | d \right |}^{\frac {3}{2}} \log \left (d \tan \left (f x + e\right ) + \sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {{\left | d \right |}} + {\left | d \right |}\right )}{f} + \frac {\sqrt {2} {\left | d \right |}^{\frac {3}{2}} \log \left (d \tan \left (f x + e\right ) - \sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {{\left | d \right |}} + {\left | d \right |}\right )}{f}}{16 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\cos \left (e+f\,x\right )}^2\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________